package com.changgou.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @Author : 残影
 * @Date: 2020-07-28 16:59
 */
public interface BrandMapper extends Mapper<Brand> {
    /**
     * 根据分类id查询品牌数据
     * @param categoryId
     * @return
     */
    @Select("SELECT tb.* FROM tb_brand tb,tb_category_brand tcb WHERE tb.id =tcb.brand_id and" +
            "tcb.category_id = #{categoryId} ")
    List<Brand> findByCategory(Integer categoryId);
}
